Users often
express interest in playing video files on their Web pages. This TechNote
shows two options for embedding the Microsoft Windows Media Player in an
HTML page to play a video file. Both options are designed for displaying
the video files on Windows. The embedded Windows Media Player will display
most video file formats in recent versions of both Microsoft Internet
Explorer and Netscape, although whether the video files display as
expected will depend on several factors, including specific configurations
on the computers viewing the video files.
You should be
comfortable with with hand-modifying source code (and this may involve
changing certain parameters) before implementing these steps. The two
options discussed in this TechNote are:
The
VideoEmbed extension Downloading the VideoEmbed extension
from the Macromedia Dreamweaver
Exchange. To find this extension, enter VideoEmbed in the
Exchange's search box. This extension will add an object to the
Objects panel which you can use to easily embed the Windows Media
Player to play a video file. Even if you download and use this
object to embed the Windows Media Player, you may still want to
review the steps below for information about changing some of the
object's parameters in the source code.
Note: This extension
will add the following "type" parameter into the
<embed> tag:
video/x-msvideo
If you
find that Netscape is not "seeing" your embedded Windows Media
Player, you might want to try changing this "type" parameter to:
application/x-mplayer2
You may
still have to advise your Netscape users to refresh the page before
the Media Player Plugin will display properly.
Adding your
own ActiveX parameters in Dreamweaver
1
In the
Document window, place the insertion point where you want the
Windows Media Player to appear.
2
Click the Insert ActiveX icon on the Special category
of the Objects panel.
3
Select the ActiveX object in the Document
window.
4
On
the Property inspector, enter the following text into the
Class ID text box:
CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95
You can copy the above text from this Web page and then
paste it into the Class ID text box.
5
Also on the Property inspector, do the
following:
a
Select Embed.
b
Set the width and height in the W and H text
boxes. A standard setting is 320 x 290 pixels.
c
Click the Browse folder icon (next to the Src
text box) and navigate to find and select a file in a
supported Media Player format. (Supported formats are
listed in the chart
below.)
d
Type
mediaplayer1 in the ID text box.
6
Click
Parameters on the Property inspector.
7
In
the Parameters dialog box, enter the following
parameters:
Parameter
Value
FileName
YourFileNameHere (same as the Src path in Step
5c)
AutoStart
True
ShowControls
True
ShowStatusBar
False
ShowDisplay
False
AutoRewind
True
You add a parameter by clicking Plus (+). The above
parameters are those most commonly chosen. You may want to
change these to suit your needs. For instance, if you would
prefer that the video not play until the viewer clicks Play,
set the AutoStart parameter to False instead of
True.
8
Switch to Code view or open the Code Inspector. Your
HTML code will now look similar to that displayed
below:
Save the
file and test on different systems and in different
browsers.
See Example 1 for a demonstration of an embedded
Windows Media Player playing a MPG video file. This file will play best in
Internet Explorer; Netscape users may experience unpredictable results. In
particular, Netscape must have the Windows Media Play plug-in
(Npdsplay.dll) for the file to play.
Media formats supported by Windows Media Player
Supported Media Formats
Windows
Microsoft Windows Media formats
.avi,
.asf, .asx, .rmi, .wav, .wma, .wax
Moving Pictures Experts Group (MPEG)
.mpg,
.mpeg, .m1v, .mp2, .mp3, .mpa, .mpe
Musical Instrument Digital Interface (MIDI)
.mid,
.rmi
Apple QuickTime®, Macintosh® AIFF Resource
.qt, .aif,
.aifc, .aiff, .mov
UNIX formats
.au,
.snd
Supported Browsers
Supported browsers
Windows
Internet Explorer 4.x
Internet Explorer 5.x
Netscape 4.x
Nescape 6
Note: Again, how different
video files will play in an embedded Windows Media Player can be
unpredictable in different browsers and on different systems. You will
want to test your pages on different systems to be sure you are getting
the consistent results that you anticipate. Some file formats, such as
some AVI files, may display on both Windows and Macintosh (QuickTime will
probably display the video files on the Macintosh). Some AVI files,
however, may play in QuickTime on both platforms but not in Windows Media
Player.
Additional
information You'll find more
information about embedding and troubleshooting the Windows Media Player
in these Microsoft resources below: